#!/bin/bash

if [ $# -ne 1 ]
then
  	echo "Usage: `basename $0` Must be run with exactly 1 parameter = number of jgap workers !"
  	exit $E_BADARGS
fi

if [ `expr $1 < 1` ]
then
	echo "The argument must be >= 1"
  	exit $E_BADARGS		
fi

server=192.168.1.100
workers=$1

for i in `seq 1 $workers`
do
	worker='worker'$i
	java -cp ".:lib/*:*" org.jgap.distr.grid.JGAPWorker -s $server -n $worker > $worker1'.log' &
done




